package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarOrderDetailsMapper;
import com.ruoyi.system.domain.CarOrderDetails;
import com.ruoyi.system.service.ICarOrderDetailsService;

/**
 * 订单详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-11
 */
@Service
public class CarOrderDetailsServiceImpl implements ICarOrderDetailsService 
{
    @Autowired
    private CarOrderDetailsMapper carOrderDetailsMapper;

    /**
     * 查询订单详情
     * 
     * @param id 订单详情主键
     * @return 订单详情
     */
    @Override
    public CarOrderDetails selectCarOrderDetailsById(Integer id)
    {
        return carOrderDetailsMapper.selectCarOrderDetailsById(id);
    }

    /**
     * 查询订单详情列表
     * 
     * @param carOrderDetails 订单详情
     * @return 订单详情
     */
    @Override
    public List<CarOrderDetails> selectCarOrderDetailsList(CarOrderDetails carOrderDetails)
    {
        return carOrderDetailsMapper.selectCarOrderDetailsList(carOrderDetails);
    }

    /**
     * 新增订单详情
     * 
     * @param carOrderDetails 订单详情
     * @return 结果
     */
    @Override
    public int insertCarOrderDetails(CarOrderDetails carOrderDetails)
    {
        return carOrderDetailsMapper.insertCarOrderDetails(carOrderDetails);
    }

    /**
     * 修改订单详情
     * 
     * @param carOrderDetails 订单详情
     * @return 结果
     */
    @Override
    public int updateCarOrderDetails(CarOrderDetails carOrderDetails)
    {
        return carOrderDetailsMapper.updateCarOrderDetails(carOrderDetails);
    }

    /**
     * 批量删除订单详情
     * 
     * @param ids 需要删除的订单详情主键
     * @return 结果
     */
    @Override
    public int deleteCarOrderDetailsByIds(Integer[] ids)
    {
        return carOrderDetailsMapper.deleteCarOrderDetailsByIds(ids);
    }

    /**
     * 删除订单详情信息
     * 
     * @param id 订单详情主键
     * @return 结果
     */
    @Override
    public int deleteCarOrderDetailsById(Integer id)
    {
        return carOrderDetailsMapper.deleteCarOrderDetailsById(id);
    }
    @Override
    //根据订单id查询详情
    public List<CarOrderDetails> getDetailsByOrderId(Integer orderId) {
        return carOrderDetailsMapper.getDetailsByOrderId(orderId);
    }
}
